<?php
$view = new swoole_atomic(0);
$pros = [];
for ($i=0;$i<10;$i++){
    $progress = new swoole_process(function(swoole_process $pro) use($i,$view){
        $pro->name("child progress...{$i}".PHP_EOL);
        $pro->write("child progress...{$i}");
        $view->add();
        sleep(1);
    },false);
    $pid = $progress->start();
    $progress->name("master progress...");
    //echo $progress->read().PHP_EOL;
    $pros[$pid] = $progress;
}
foreach ($pros as $pid => $pro){
    swoole_process::wait();
    echo "read==".$pro->read()."=====".$pro->pid.PHP_EOL;
}
echo $view->get();